package com.todo.auth.remote;

import com.todo.common.common.entity.response.BizResponse;
import com.todo.user.api.request.QueryUserAccountByUserNameRequest;
import com.todo.user.api.request.RegisterUserAccountByNameRequest;
import com.todo.user.api.request.RemoveUserAccountByUserNameRequest;
import com.todo.user.api.request.UpdateUserSecretRequest;
import com.todo.user.api.response.UserAccountResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author azhebuxing
 * @date 2025/2/20 00:52
 * @description
 */
@FeignClient(name = "todoUserService", url = "http://localhost:18000")
public interface UserAccountRemoteService {

    /**
     * 根据用户名注册
     *
     * @param request
     * @return
     */
    @PostMapping("/api/userAccount/registerUserAccountByName")
    BizResponse<Boolean> registerUserAccountByName(@RequestBody RegisterUserAccountByNameRequest request);

    /**
     * 根据用户名查询用户信息
     *
     * @param request
     * @return
     */
    @PostMapping("/api/userAccount/queryUserAccountByUserName")
    BizResponse<UserAccountResponse> queryUserAccountByUserName(@RequestBody QueryUserAccountByUserNameRequest request);

    /**
     * 更新用户密码
     *
     * @param request
     * @return
     */
    @PostMapping("/api/userAccount/updateUserSecret")
    BizResponse<Boolean> updateUserSecret(@RequestBody UpdateUserSecretRequest request);

    /**
     * 根据用户名删除用户信息(注销)
     *
     * @param request
     * @return
     */
    @PostMapping("/api/userAccount/removeUserAccountByUserName")
    BizResponse<Boolean> removeUserAccountByUserName(@RequestBody RemoveUserAccountByUserNameRequest request);
}
